package com.zbbt.sportslottery.net.parser;

import org.json.JSONException;
import org.json.JSONObject;

public class ResultParser {

	public static Result parse(JSONObject json) throws JSONException {
		Result mResult = new Result();

		if (json.has("code")) {
			mResult.setCode(json.optString("code"));
		}
		if (json.has("msg")) {
			mResult.setMsg(json.optString("msg"));
		}
		if (json.has("result")) {
			mResult.setResult(json.optString("result"));
		}
		if (json.has("time")) {
			mResult.setTime(json.optLong("time"));
		}
		return mResult;
	}
}
